from fastapi import FastAPI
from control import data_router
from index import index_router
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(router=index_router, prefix="/index")
app.include_router(router=data_router, prefix="/batch/data")
